package views

import (
	"errors"
	"fmt"
	"log"
	"net/http"

	"gitee.com/Yu-eng/Myproject/my-go-blog/common"
	"gitee.com/Yu-eng/Myproject/my-go-blog/service"
)

func (*HTMLApi) Writing(w http.ResponseWriter, r *http.Request) {
	writing := common.Template.Writing
	wr, err := service.Writing()
	fmt.Println("----------", wr)
	if err != nil {
		log.Println("Writing 错误,", err)
		writing.WriteError(w, errors.New("写入页面加载错误！"))
		return
	}
	writing.WriteData(w, wr)
}
